package com.rui.adapter.obj.Interface;

import com.rui.adapter.obj.AC220;
import com.rui.adapter.obj.AC360;
import com.rui.adapter.obj.Power;
import lombok.AllArgsConstructor;

/**
 * @Description: 适配器类（电源适配器）
 * @Author: ZhangRui
 * @Date: 2023/3/2 16:38
 * @Version: 1.0
 */
@AllArgsConstructor
public class InterfacePowerAdapter implements DC {

    private Power power;

    @Override
    public int output5() {
        int output = power.output();

        if (power instanceof AC360) {
            return output / 72;
        }

        if (power instanceof AC220) {
            return output / 44;
        }

        return 0;
    }

    @Override
    public int output12() {
        // 具体实现逻辑
        return 12;
    }

    @Override
    public int output24() {
        // 具体实现逻辑
        return 24;
    }

    @Override
    public int output30() {
        // 具体实现逻辑
        return 30;
    }
}